package cate.common.table.activity.dailygift;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "礼包配置")
public class DailyGiftConfigRow extends ERow {
    @NoteField(value = "活动配置ID")
    public int confId;
    @NoteField(value = "礼包配置")
    public String giftStr;
    @NoteField(value = "随机碎片默认概率")
    public String numRandomStr;
    @NoteField(value = "价格")
    public int price;
    @NoteField(value = "充值项")
    public int payItemId;
    @NoteField(value = "vip")
    public int vip;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID");
        this.confId = xrw.getInteger("活动配置ID");
        this.giftStr = xrw.getString("礼包配置", "");
        this.numRandomStr = xrw.getString("随机碎片默认概率", "");
        this.price = xrw.getInteger("价格", 9999999);
        this.payItemId = xrw.getInteger("充值项ID", -1);
        this.vip = xrw.getInteger("vip", 0);
    }

    @JsonIgnore
    public RandomNumItems randomList = new RandomNumItems();

    @Override
    public void decode() {
        randomList.parse(numRandomStr);
    }

}
